<ui:composition template="WEB-INF/templates/standard.xhtml"
				xmlns="http://www.w3.org/1999/xhtml"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:p="http://primefaces.prime.com.tr/ui">
	<ui:param name="page_title" value="Banker"/>
	<ui:define name="content">

		<h:form>
			Namn:<br />
			<h:inputText value="#{banksControllerBean.newName}" /><br />
			<h:commandButton actionListener="#{banksControllerBean.addClick}" value="Add"/>
		</h:form>
		<p:separator />  
		<h:form>
			<p:dataTable styleClass="datatable" var="bank" value="#{banksBackingBean.banks}" id="bankList" rowEditListener="#{banksControllerBean.updateBank}">
				<f:facet name="header">
					Banker
				</f:facet>

				<p:column headerText="Id" style="width:30px">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{bank.id}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText readonly="true" value="#{bank.id}" style="width:20px"/>
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Namn">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{bank.name}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{bank.name}" style="width:99%"/>
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Ikon" style="width: 10px;">
					<p:cellEditor>
						<f:facet name="output">
							<img align="right" src="data:image/png;base64,#{bank.icon}" />
						</f:facet>
						<f:facet name="input">
							<h:outputText value="apa" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Kod" style="width: 10px;">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value=""/>
						</f:facet>
						<f:facet name="input">
							<h:outputText value=""/>
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Ta bort" style="width: 10px;">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value=""/>
						</f:facet>
						<f:facet name="input">
							<h:commandButton actionListener="#{banksControllerBean.deleteBank}" value="Ta bort">
								<f:attribute name="bank" value="#{bank}" />
							</h:commandButton>
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Options" style="width: 20px;">
					<p:rowEditor />
				</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>